#ifndef INTERPRETER_CPP
#define INTERPRETER_CPP

#include "GOAL.h"
#include "Interpreter.h"
#include "stdafx.h"
#include "UmlExt.h"

std::map <Uml::Class,Uml::Class> GOAL::Interpreter::derived_;
bool GOAL::Interpreter::initialized_ = false;

GOAL::Interpreter::Interpreter ()
: context_ ()
{
  if (!initialized_)
    {
      // common connections
      derived_[GOAL::AssignmentConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::ArgumentConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::AssignmentRHSConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::ArrayAssignmentConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::OutputConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::IndexConnection::meta] = GOAL::CommonConnection::meta;
      derived_[GOAL::NonModifyingConnection::meta] = GOAL::CommonConnection::meta;

      // rhs elements
      derived_[GOAL::Not::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Plus::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Minus::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Times::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Divide::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Modulus::meta] = GOAL::RightHandSideObject::meta;
      
 //     derived_[GOAL::Variable::meta] = GOAL::RightHandSideObject::meta;

      derived_[GOAL::FunctionCall::meta] = GOAL::RightHandSideObject::meta;

      derived_[GOAL::Const::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Brackets::meta] = GOAL::RightHandSideObject::meta;

      derived_[GOAL::And::meta] = GOAL::RightHandSideObject::meta;
      derived_[GOAL::Or::meta] = GOAL::RightHandSideObject::meta;

      derived_[GOAL::For::meta] = GOAL::ControlBase::meta;

      derived_[GOAL::File::meta] = GOAL::Output::meta;
      derived_[GOAL::Console::meta] = GOAL::Output::meta;
      derived_[GOAL::Variable::meta] = GOAL::Output::meta;
      derived_[GOAL::Brackets::meta] = GOAL::RightHandSideObject::meta;

      initialized_ = true;
    }
}

GOAL::Interpreter::~Interpreter ()
{

}


#endif // INTREPRETER_H